
//
//  VideoCollectionViewCell.m
//  LuckyRadio
//
//  Created by JiaRui on 15/11/20.
//  Copyright © 2015年 chenjun. All rights reserved.
//

#import "VideoCollectionViewCell.h"

@implementation VideoCollectionViewCell
- (void)dealloc
{
    [_play release];
    [_titleLable release];
    [_singerLable release];
    [_mvView release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        
        self.titleLable= [[UILabel alloc]init];
        self.singerLable = [[UILabel alloc]init];
        
        self.mvView = [[UIImageView alloc]init];
        self.play = [[UIImageView alloc]init];

        [self.mvView addSubview:self.play];
        [self.contentView addSubview:self.titleLable];
        [self.contentView addSubview:self.singerLable];
        [self.contentView addSubview:self.mvView];
        
        [_play release];
        [_titleLable release];
        [_singerLable release];
        [_mvView release];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLable.frame = CGRectMake(10, self.frame.size.height - 75, self.frame.size.width - 20, 40);
    self.singerLable.frame = CGRectMake(10, self.frame.size.height - 30, self.frame.size.width - 20, 30);
    self.mvView.frame = CGRectMake(10, 5, self.frame.size.width - 20, self.frame.size.height - 75);
    self.play.frame = CGRectMake(self.mvView.frame.size.width / 2 - 30, self.mvView.frame.size.height / 2 - 30, 60, 60);
    [self.play setImage:[UIImage imageNamed:@"mv_player"]];
}
-(void)setModel:(MVClassModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.titleLable.text = model.videoName;
    self.titleLable.font = [UIFont systemFontOfSize:22];
    self.singerLable.text = model.singerName;
    self.singerLable.font = [UIFont systemFontOfSize:19];
    [self.mvView sd_setImageWithURL:[NSURL URLWithString:[model.mvList[0] picUrl]]placeholderImage:[UIImage imageNamed:@"Read_zhanwei"]];
}

@end
